#include "stdafx.h"

#include "thermal_keywords.h"

namespace blue_sky
{
	template<class strategy_t>
	thermal_keywords<strategy_t>::thermal_keywords(bs_type_ctor_param)
	{
	}

	template<class strategy_t>
	thermal_keywords<strategy_t>::thermal_keywords(const thermal_keywords<strategy_t>& src)
		: bs_refcounter (src), base_t (src)
	{
		// TODO: BUG:
		bs_throw_exception ("NOT IMPL YET");
		//*this = src;
	}

	template<class strategy_t>
	void thermal_keywords<strategy_t>::register_keywords (sp_objbase &km, std::string provider) const
	{
		smart_ptr <keyword_manager_iface <strategy_t>, true> keyword_manager (km);
		if (provider == "")
        {
          provider = "THERMAL";
          keyword_manager->register_keyword ("THERMAL", keyword_handler (&this_t::THERMAL_handler));
        }
		keyword_manager->register_supported_keyword ("TEMPERATURE", provider);
	}

	template<class strategy_t>
	void thermal_keywords<strategy_t>::activate_keywords(sp_objbase &km)
	{
		smart_ptr <keyword_manager_iface <strategy_t>, true> keyword_manager (km);
		index_t array_dimens[6] = {1,0,1,0,1,0};

		keyword_manager->register_keyword ("TEMPERATURE", keyword_handler (0, (item_t)0.0, &array_dimens[0]));
	}

	template <class strategy_t>
	void thermal_keywords<strategy_t>::THERMAL_handler(const std::string &keyword, keyword_params_t &params)
	{
		activate_keywords(params.km);
	}

	BLUE_SKY_TYPE_STD_CREATE_T_DEF (thermal_keywords, (class))
	BLUE_SKY_TYPE_STD_COPY_T_DEF (thermal_keywords, (class))
	BLUE_SKY_TYPE_IMPL_T_EXT (1, (thermal_keywords<base_strategy_fi>), 1, (keyword_info_base<base_strategy_fi>), 
		"BOS Core struct_thermal keyword_info_base_fi", "THERMAL", "Thermal reservoir sumulator keywords", false)
	BLUE_SKY_TYPE_IMPL_T_EXT (1, (thermal_keywords<base_strategy_di>), 1, (keyword_info_base<base_strategy_di>), 
		"BOS_Core struct_mesh keyword_info_base_di", "THERMAL", "Thermal reservoir sumulator keywords", false)
	BLUE_SKY_TYPE_IMPL_T_EXT (1, (thermal_keywords<base_strategy_mixi>), 1, (keyword_info_base<base_strategy_mixi>), 
		"BOS_Core struct_mesh keyword_info_base_mixi", "THERMAL", "Thermal reservoir sumulator keywords", false)
}